using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._CartographyTools._GraphicConflicts
{
    /// <summary>
    /// <para>Resolve Building Conflicts</para>
    /// <para>Resolves symbol conflicts among buildings with respect to linear barrier features by moving, resizing, or hiding buildings.</para>
    /// <para>通过移动、调整大小或隐藏建筑物来解决建筑物之间与线性障碍要素相关的符号冲突。</para>
    /// </summary>    
    [DisplayName("Resolve Building Conflicts")]
    public class ResolveBuildingConflicts : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public ResolveBuildingConflicts()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_buildings">
        /// <para>Input Building Layers</para>
        /// <para><xdoc>
        ///   <para>The input layers containing building features that may be in conflict or smaller than allowable size. Buildings can be either points or polygons. Buildings will be modified to resolve conflicts with other buildings and with barrier features.</para>
        ///   <para>When point building layers are used as inputs, the Angle property of the marker symbol layer must be set to a field in the feature class. This field will store the rotation adjustments</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>包含可能冲突或小于允许大小的建筑要素的输入图层。建筑物可以是点，也可以是多边形。将对建筑物进行修改，以解决与其他建筑物和障碍物的冲突。</para>
        ///   <para>当点构建图层用作输入时，必须将标记符号图层的 Angle 属性设置为要素类中的字段。此字段将存储旋转调整</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_invisibility_field">
        /// <para>Invisibility Field</para>
        /// <para>The field that stores the invisibility values that can be used to remove some buildings from display to resolve symbol conflicts. Buildings with a value of 1 will be removed from display; those with a value of zero will not be removed. Use a definition query on the layer to display visible buildings only. No features are deleted.</para>
        /// <para>存储不可见值的字段，这些不可见值可用于从显示中删除某些建筑物以解决符号冲突。值为 1 的建筑物将从显示中删除;值为零的那些不会被删除。在图层上使用定义查询仅显示可见建筑物。不会删除任何要素。</para>
        /// </param>
        /// <param name="_in_barriers">
        /// <para>Input Barrier Layers</para>
        /// <para><xdoc>
        ///   <para>The layers containing the linear or polygon features that are conflict barriers for input building features. Buildings will be modified to resolve conflicts between buildings and barriers. The orient value is Boolean, specifying whether buildings will be oriented to the barrier layer.</para>
        ///   <para>Gap specifies the distance that buildings will move toward or away from the barrier layer. A unit must be entered with the value.
        ///   <bulletList>
        ///     <bullet_item>A gap value of 0 (zero) will snap buildings directly to the edge of the barrier line or outline symbology.  </bullet_item><para/>
        ///     <bullet_item>A null (unspecified) gap value means that buildings will not be moved toward or away from barrier lines or outlines except movement required by conflict resolution.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        ///   <para>If no unit is entered with the gap value (that is, 10 instead of 10 meters), the linear unit from the input feature's coordinate system will be used.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>包含作为输入建筑要素的冲突屏障的线性或面要素的图层。建筑物将被修改以解决建筑物和障碍物之间的冲突。orient 值为 Boolean，用于指定建筑物是否面向屏障层。</para>
        /// <para>间隙指定建筑物向或远离屏障层移动的距离。必须输入一个单位和值。
        ///   <bulletList>
        ///     <bullet_item>间隙值为 0（零）时，建筑物将直接捕捉到障碍线或轮廓符号系统的边缘。</bullet_item><para/>
        ///     <bullet_item>空（未指定）间隙值表示建筑物不会向障碍线或轮廓移动或远离障碍线或轮廓，除非冲突解决需要移动。</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        ///   <para>如果未输入间隙值（即 10 米而不是 10 米）的单位，则将使用输入要素坐标系中的线性单位。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_building_gap">
        /// <para>Building Gap</para>
        /// <para>The minimum allowable distance between symbolized buildings at scale. Buildings that are closer together will be displaced or hidden to enforce this distance. The minimum allowable distance is set relative to the reference scale (that is, 15 meters at 1:50,000 scale). The value is 0 if the reference scale is not set.</para>
        /// <para>按比例标示的建筑物之间的最小允许距离。距离较近的建筑物将被移位或隐藏以强制执行此距离。最小允许距离是相对于参考比例设置的（即 1：50,000 比例为 15 米）。如果未设置参考刻度，则该值为 0。</para>
        /// </param>
        /// <param name="_minimum_size">
        /// <para>Minimum Allowable Building Size</para>
        /// <para>The minimum allowable size of the shortest side of a rotated best-fit bounding box around the symbolized building feature drawn at the reference scale. Buildings with a bounding box side smaller than this value will be enlarged to meet it. Resizing may occur nonproportionally, resulting in a change to the building morphology.</para>
        /// <para>以参考比例绘制的符号化建筑要素周围的旋转最佳拟合边界框的最短边的最小允许尺寸。边界框边小于此值的建筑物将被放大以满足该值。调整大小可能会不成比例地发生，从而导致建筑物形态发生变化。</para>
        /// </param>
        public ResolveBuildingConflicts(List<object> _in_buildings, object _invisibility_field, object _in_barriers, string? _building_gap, string? _minimum_size)
        {
            this._in_buildings = _in_buildings;
            this._invisibility_field = _invisibility_field;
            this._in_barriers = _in_barriers;
            this._building_gap = _building_gap;
            this._minimum_size = _minimum_size;
        }
        public override string ToolboxName => "Cartography Tools";

        public override string ToolName => "Resolve Building Conflicts";

        public override string CallName => "cartography.ResolveBuildingConflicts";

        public override List<string> AcceptEnvironments => ["cartographicCoordinateSystem", "cartographicPartitions", "referenceScale"];

        public override object[] ParameterInfo => [_in_buildings, _invisibility_field, _in_barriers, _building_gap, _minimum_size, _hierarchy_field, _out_layers];

        /// <summary>
        /// <para>Input Building Layers</para>
        /// <para><xdoc>
        ///   <para>The input layers containing building features that may be in conflict or smaller than allowable size. Buildings can be either points or polygons. Buildings will be modified to resolve conflicts with other buildings and with barrier features.</para>
        ///   <para>When point building layers are used as inputs, the Angle property of the marker symbol layer must be set to a field in the feature class. This field will store the rotation adjustments</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>包含可能冲突或小于允许大小的建筑要素的输入图层。建筑物可以是点，也可以是多边形。将对建筑物进行修改，以解决与其他建筑物和障碍物的冲突。</para>
        ///   <para>当点构建图层用作输入时，必须将标记符号图层的 Angle 属性设置为要素类中的字段。此字段将存储旋转调整</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Building Layers")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public List<object> _in_buildings { get; set; }


        /// <summary>
        /// <para>Invisibility Field</para>
        /// <para>The field that stores the invisibility values that can be used to remove some buildings from display to resolve symbol conflicts. Buildings with a value of 1 will be removed from display; those with a value of zero will not be removed. Use a definition query on the layer to display visible buildings only. No features are deleted.</para>
        /// <para>存储不可见值的字段，这些不可见值可用于从显示中删除某些建筑物以解决符号冲突。值为 1 的建筑物将从显示中删除;值为零的那些不会被删除。在图层上使用定义查询仅显示可见建筑物。不会删除任何要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Invisibility Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _invisibility_field { get; set; }


        /// <summary>
        /// <para>Input Barrier Layers</para>
        /// <para><xdoc>
        ///   <para>The layers containing the linear or polygon features that are conflict barriers for input building features. Buildings will be modified to resolve conflicts between buildings and barriers. The orient value is Boolean, specifying whether buildings will be oriented to the barrier layer.</para>
        ///   <para>Gap specifies the distance that buildings will move toward or away from the barrier layer. A unit must be entered with the value.
        ///   <bulletList>
        ///     <bullet_item>A gap value of 0 (zero) will snap buildings directly to the edge of the barrier line or outline symbology.  </bullet_item><para/>
        ///     <bullet_item>A null (unspecified) gap value means that buildings will not be moved toward or away from barrier lines or outlines except movement required by conflict resolution.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        ///   <para>If no unit is entered with the gap value (that is, 10 instead of 10 meters), the linear unit from the input feature's coordinate system will be used.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>包含作为输入建筑要素的冲突屏障的线性或面要素的图层。建筑物将被修改以解决建筑物和障碍物之间的冲突。orient 值为 Boolean，用于指定建筑物是否面向屏障层。</para>
        /// <para>间隙指定建筑物向或远离屏障层移动的距离。必须输入一个单位和值。
        ///   <bulletList>
        ///     <bullet_item>间隙值为 0（零）时，建筑物将直接捕捉到障碍线或轮廓符号系统的边缘。</bullet_item><para/>
        ///     <bullet_item>空（未指定）间隙值表示建筑物不会向障碍线或轮廓移动或远离障碍线或轮廓，除非冲突解决需要移动。</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        ///   <para>如果未输入间隙值（即 10 米而不是 10 米）的单位，则将使用输入要素坐标系中的线性单位。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Barrier Layers")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_barriers { get; set; }


        /// <summary>
        /// <para>Building Gap</para>
        /// <para>The minimum allowable distance between symbolized buildings at scale. Buildings that are closer together will be displaced or hidden to enforce this distance. The minimum allowable distance is set relative to the reference scale (that is, 15 meters at 1:50,000 scale). The value is 0 if the reference scale is not set.</para>
        /// <para>按比例标示的建筑物之间的最小允许距离。距离较近的建筑物将被移位或隐藏以强制执行此距离。最小允许距离是相对于参考比例设置的（即 1：50,000 比例为 15 米）。如果未设置参考刻度，则该值为 0。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Building Gap")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public string? _building_gap { get; set; }


        /// <summary>
        /// <para>Minimum Allowable Building Size</para>
        /// <para>The minimum allowable size of the shortest side of a rotated best-fit bounding box around the symbolized building feature drawn at the reference scale. Buildings with a bounding box side smaller than this value will be enlarged to meet it. Resizing may occur nonproportionally, resulting in a change to the building morphology.</para>
        /// <para>以参考比例绘制的符号化建筑要素周围的旋转最佳拟合边界框的最短边的最小允许尺寸。边界框边小于此值的建筑物将被放大以满足该值。调整大小可能会不成比例地发生，从而导致建筑物形态发生变化。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Minimum Allowable Building Size")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public string? _minimum_size { get; set; }


        /// <summary>
        /// <para>Hierarchy Field</para>
        /// <para>The field that contains hierarchical ranking of feature importance in which 1 is very important and larger integers reflect decreasing importance. A value of 0 (zero) causes the building to retain visibility, although it may be moved somewhat to resolve conflicts. If this parameter is not used, feature importance will be assessed by the tool based on perimeter length and proximity to barrier features.</para>
        /// <para>包含特征重要性的分层排名的字段，其中 1 非常重要，较大的整数表示重要性递减。值为 0（零）可使建筑物保持可见性，尽管可能会稍微移动建筑物以解决冲突。如果未使用此参数，则工具将根据周长和与障碍物的接近程度来评估要素重要性。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Hierarchy Field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _hierarchy_field { get; set; } = null;


        /// <summary>
        /// <para>Output Layers</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Layers")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public List<object> _out_layers { get; set; }


        public ResolveBuildingConflicts SetEnv(object cartographicCoordinateSystem = null, object cartographicPartitions = null, object referenceScale = null)
        {
            base.SetEnv(cartographicCoordinateSystem: cartographicCoordinateSystem, cartographicPartitions: cartographicPartitions, referenceScale: referenceScale);
            return this;
        }

    }

}